<!DOCTYPE html>
<html lang=en>
<head>
    <!-- so meta -->
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="HandheldFriendly" content="True">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
    <meta name="description" content="一篇不一样的docker原理解析 提高篇 uncle creepy 擅长分析分布式一致性系统，数据处理，系统负载均衡等问题 在上一篇 一篇不一样的docker原理解析 - uncle creepy的文章 - 知乎专栏 中，主要讨论了容器和虚拟机的区别，在实现细节上并没有深入，只是点到即止，在这篇提高篇中，将详细讨论容器的实现细节，当然我不希望把文章写成对于kernel man page的简单翻译，">
<meta property="og:type" content="article">
<meta property="og:title" content="一篇不一样的docker原理解析提高篇">
<meta property="og:url" content="http://yoursite.com/2018/12/21/%E4%B8%80%E7%AF%87%E4%B8%8D%E4%B8%80%E6%A0%B7%E7%9A%84docker%E5%8E%9F%E7%90%86%E8%A7%A3%E6%9E%90%E6%8F%90%E9%AB%98%E7%AF%87/index.html">
<meta property="og:site_name" content="TmoonSite">
<meta property="og:description" content="一篇不一样的docker原理解析 提高篇 uncle creepy 擅长分析分布式一致性系统，数据处理，系统负载均衡等问题 在上一篇 一篇不一样的docker原理解析 - uncle creepy的文章 - 知乎专栏 中，主要讨论了容器和虚拟机的区别，在实现细节上并没有深入，只是点到即止，在这篇提高篇中，将详细讨论容器的实现细节，当然我不希望把文章写成对于kernel man page的简单翻译，">
<meta property="og:locale" content="en_US">
<meta property="og:image" content="https://pic4.zhimg.com/da8e974dc_xs.jpg">
<meta property="og:image" content="https://pic3.zhimg.com/80/9881b7d20842e3a8efa097ef63291a1b_hd.jpg">
<meta property="article:published_time" content="2018-12-21T05:30:16.000Z">
<meta property="article:modified_time" content="2020-01-07T10:48:14.750Z">
<meta property="article:author" content="Tmoonlight">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://pic4.zhimg.com/da8e974dc_xs.jpg">
    
    
        
          
              <link rel="shortcut icon" href="/images/favicon.ico">
          
        
        
          
            <link rel="icon" type="image/png" href="/images/logo2.gif" sizes="192x192">
          
        
        
          
            <link rel="apple-touch-icon" sizes="180x180" href="/images/logo2.gif">
          
        
    
    <!-- title -->
    <title>一篇不一样的docker原理解析提高篇</title>
    <!-- styles -->
    
<link rel="stylesheet" href="/css/style.css">

    <!-- persian styles -->
    
      
<link rel="stylesheet" href="/css/rtl.css">

    
    <!-- rss -->
    
    
<meta name="generator" content="Hexo 4.2.0"></head>

<body class="max-width mx-auto px3 ltr">
    
      <div id="header-post">
  <a id="menu-icon" href="#"><i class="fas fa-bars fa-lg"></i></a>
  <a id="menu-icon-tablet" href="#"><i class="fas fa-bars fa-lg"></i></a>
  <a id="top-icon-tablet" href="#" onclick="$('html, body').animate({ scrollTop: 0 }, 'fast');" style="display:none;"><i class="fas fa-chevron-up fa-lg"></i></a>
  <span id="menu">
    <span id="nav">
      <ul>
         
          <li><a href="/">Home</a></li>
         
          <li><a href="/about/">About</a></li>
         
          <li><a href="/archives/">Writing</a></li>
         
          <li><a href="/projects_url">Projects</a></li>
        
      </ul>
    </span>
    <br/>
    <span id="actions">
      <ul>
        
        <li><a class="icon" href="/2018/12/24/%E5%86%8D%E8%B0%88%E4%B8%AD%E9%97%B4%E4%BB%B6%E5%92%8Chttpmodule%E7%9A%84%E5%8C%BA%E5%88%AB/"><i class="fas fa-chevron-left" aria-hidden="true" onmouseover="$('#i-prev').toggle();" onmouseout="$('#i-prev').toggle();"></i></a></li>
        
        
        <li><a class="icon" href="/2018/12/17/%E4%B8%80%E7%AF%87%E4%B8%8D%E4%B8%80%E6%A0%B7%E7%9A%84docker%E5%8E%9F%E7%90%86%E8%A7%A3%E6%9E%90/"><i class="fas fa-chevron-right" aria-hidden="true" onmouseover="$('#i-next').toggle();" onmouseout="$('#i-next').toggle();"></i></a></li>
        
        <li><a class="icon" href="#" onclick="$('html, body').animate({ scrollTop: 0 }, 'fast');"><i class="fas fa-chevron-up" aria-hidden="true" onmouseover="$('#i-top').toggle();" onmouseout="$('#i-top').toggle();"></i></a></li>
        <li><a class="icon" href="#"><i class="fas fa-share-alt" aria-hidden="true" onmouseover="$('#i-share').toggle();" onmouseout="$('#i-share').toggle();" onclick="$('#share').toggle();return false;"></i></a></li>
      </ul>
      <span id="i-prev" class="info" style="display:none;">Previous post</span>
      <span id="i-next" class="info" style="display:none;">Next post</span>
      <span id="i-top" class="info" style="display:none;">Back to top</span>
      <span id="i-share" class="info" style="display:none;">Share post</span>
    </span>
    <br/>
    <div id="share" style="display: none">
      <ul>
  <li><a class="icon" href="http://www.facebook.com/sharer.php?u=http://yoursite.com/2018/12/21/%E4%B8%80%E7%AF%87%E4%B8%8D%E4%B8%80%E6%A0%B7%E7%9A%84docker%E5%8E%9F%E7%90%86%E8%A7%A3%E6%9E%90%E6%8F%90%E9%AB%98%E7%AF%87/" target="_blank" rel="noopener"><i class="fab fa-facebook " aria-hidden="true"></i></a></li>
  <li><a class="icon" href="https://twitter.com/share?url=http://yoursite.com/2018/12/21/%E4%B8%80%E7%AF%87%E4%B8%8D%E4%B8%80%E6%A0%B7%E7%9A%84docker%E5%8E%9F%E7%90%86%E8%A7%A3%E6%9E%90%E6%8F%90%E9%AB%98%E7%AF%87/&text=一篇不一样的docker原理解析提高篇" target="_blank" rel="noopener"><i class="fab fa-twitter " aria-hidden="true"></i></a></li>
  <li><a class="icon" href="http://www.linkedin.com/shareArticle?url=http://yoursite.com/2018/12/21/%E4%B8%80%E7%AF%87%E4%B8%8D%E4%B8%80%E6%A0%B7%E7%9A%84docker%E5%8E%9F%E7%90%86%E8%A7%A3%E6%9E%90%E6%8F%90%E9%AB%98%E7%AF%87/&title=一篇不一样的docker原理解析提高篇" target="_blank" rel="noopener"><i class="fab fa-linkedin " aria-hidden="true"></i></a></li>
  <li><a class="icon" href="https://pinterest.com/pin/create/bookmarklet/?url=http://yoursite.com/2018/12/21/%E4%B8%80%E7%AF%87%E4%B8%8D%E4%B8%80%E6%A0%B7%E7%9A%84docker%E5%8E%9F%E7%90%86%E8%A7%A3%E6%9E%90%E6%8F%90%E9%AB%98%E7%AF%87/&is_video=false&description=一篇不一样的docker原理解析提高篇" target="_blank" rel="noopener"><i class="fab fa-pinterest " aria-hidden="true"></i></a></li>
  <li><a class="icon" href="mailto:?subject=一篇不一样的docker原理解析提高篇&body=Check out this article: http://yoursite.com/2018/12/21/%E4%B8%80%E7%AF%87%E4%B8%8D%E4%B8%80%E6%A0%B7%E7%9A%84docker%E5%8E%9F%E7%90%86%E8%A7%A3%E6%9E%90%E6%8F%90%E9%AB%98%E7%AF%87/"><i class="fas fa-envelope " aria-hidden="true"></i></a></li>
  <li><a class="icon" href="https://getpocket.com/save?url=http://yoursite.com/2018/12/21/%E4%B8%80%E7%AF%87%E4%B8%8D%E4%B8%80%E6%A0%B7%E7%9A%84docker%E5%8E%9F%E7%90%86%E8%A7%A3%E6%9E%90%E6%8F%90%E9%AB%98%E7%AF%87/&title=一篇不一样的docker原理解析提高篇" target="_blank" rel="noopener"><i class="fab fa-get-pocket " aria-hidden="true"></i></a></li>
  <li><a class="icon" href="http://reddit.com/submit?url=http://yoursite.com/2018/12/21/%E4%B8%80%E7%AF%87%E4%B8%8D%E4%B8%80%E6%A0%B7%E7%9A%84docker%E5%8E%9F%E7%90%86%E8%A7%A3%E6%9E%90%E6%8F%90%E9%AB%98%E7%AF%87/&title=一篇不一样的docker原理解析提高篇" target="_blank" rel="noopener"><i class="fab fa-reddit " aria-hidden="true"></i></a></li>
  <li><a class="icon" href="http://www.stumbleupon.com/submit?url=http://yoursite.com/2018/12/21/%E4%B8%80%E7%AF%87%E4%B8%8D%E4%B8%80%E6%A0%B7%E7%9A%84docker%E5%8E%9F%E7%90%86%E8%A7%A3%E6%9E%90%E6%8F%90%E9%AB%98%E7%AF%87/&title=一篇不一样的docker原理解析提高篇" target="_blank" rel="noopener"><i class="fab fa-stumbleupon " aria-hidden="true"></i></a></li>
  <li><a class="icon" href="http://digg.com/submit?url=http://yoursite.com/2018/12/21/%E4%B8%80%E7%AF%87%E4%B8%8D%E4%B8%80%E6%A0%B7%E7%9A%84docker%E5%8E%9F%E7%90%86%E8%A7%A3%E6%9E%90%E6%8F%90%E9%AB%98%E7%AF%87/&title=一篇不一样的docker原理解析提高篇" target="_blank" rel="noopener"><i class="fab fa-digg " aria-hidden="true"></i></a></li>
  <li><a class="icon" href="http://www.tumblr.com/share/link?url=http://yoursite.com/2018/12/21/%E4%B8%80%E7%AF%87%E4%B8%8D%E4%B8%80%E6%A0%B7%E7%9A%84docker%E5%8E%9F%E7%90%86%E8%A7%A3%E6%9E%90%E6%8F%90%E9%AB%98%E7%AF%87/&name=一篇不一样的docker原理解析提高篇&description=" target="_blank" rel="noopener"><i class="fab fa-tumblr " aria-hidden="true"></i></a></li>
  <li><a class="icon" href="https://news.ycombinator.com/submitlink?u=http://yoursite.com/2018/12/21/%E4%B8%80%E7%AF%87%E4%B8%8D%E4%B8%80%E6%A0%B7%E7%9A%84docker%E5%8E%9F%E7%90%86%E8%A7%A3%E6%9E%90%E6%8F%90%E9%AB%98%E7%AF%87/&t=一篇不一样的docker原理解析提高篇" target="_blank" rel="noopener"><i class="fab fa-hacker-news " aria-hidden="true"></i></a></li>
</ul>

    </div>
    <div id="toc">
      <ol class="toc"><li class="toc-item toc-level-1"><a class="toc-link" href="#一篇不一样的docker原理解析-提高篇"><span class="toc-number">1.</span> <span class="toc-text">一篇不一样的docker原理解析 提高篇</span></a><ol class="toc-child"><li class="toc-item toc-level-2"><a class="toc-link" href="#0-从fork说起"><span class="toc-number">1.1.</span> <span class="toc-text">0 从fork说起</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#1-namespace让进程隔离更灵活"><span class="toc-number">1.2.</span> <span class="toc-text">1 namespace让进程隔离更灵活</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#2-其实docker是一个内核的搬运工"><span class="toc-number">1.3.</span> <span class="toc-text">2 其实docker是一个内核的搬运工</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#3-容器内创建进程-—-Think-a-step-further"><span class="toc-number">1.4.</span> <span class="toc-text">3 容器内创建进程 — Think a step further</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#4-One-more-thing"><span class="toc-number">1.5.</span> <span class="toc-text">4 One more thing</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#5-how-to-learn-more"><span class="toc-number">1.6.</span> <span class="toc-text">5 how to learn more</span></a></li></ol></li></ol>
    </div>
  </span>
</div>

    
    <div class="content index py4">
        
        <article class="post" itemscope itemtype="http://schema.org/BlogPosting">
  <header>
    
    <h1 class="posttitle" itemprop="name headline">
        一篇不一样的docker原理解析提高篇
    </h1>



    <div class="meta">
      <span class="author" itemprop="author" itemscope itemtype="http://schema.org/Person">
        <span itemprop="name">TmoonSite</span>
      </span>
      
    <div class="postdate">
      
        <time datetime="2018-12-21T05:30:16.000Z" itemprop="datePublished">2018-12-21</time>
        
      
    </div>


      

      

    </div>
  </header>
  

  <div class="content" itemprop="articleBody">
    <h1 id="一篇不一样的docker原理解析-提高篇"><a href="#一篇不一样的docker原理解析-提高篇" class="headerlink" title="一篇不一样的docker原理解析 提高篇"></a>一篇不一样的docker原理解析 提高篇</h1><p><a href="https://www.zhihu.com/people/creepyuncle" target="_blank" rel="noopener"><img src="https://pic4.zhimg.com/da8e974dc_xs.jpg" alt=""></a></p>
<p><a href="https://www.zhihu.com/people/creepyuncle" target="_blank" rel="noopener">uncle creepy</a></p>
<p>擅长分析分布式一致性系统，数据处理，系统负载均衡等问题</p>
<p>在上一篇 <a href="https://zhuanlan.zhihu.com/p/22382728" target="_blank" rel="noopener">一篇不一样的docker原理解析 - uncle creepy的文章 - 知乎专栏</a> 中，主要讨论了容器和虚拟机的区别，在实现细节上并没有深入，只是点到即止，在这篇提高篇中，将详细讨论容器的实现细节，当然我不希望把文章写成对于kernel man page的简单翻译，所以不熟悉内核和linux api的读者可以不急着点叉，这会是一篇不一样的讨论容器实现的提高篇。</p>
<p>在开始讨论前，先抛出一个问题：</p>
<ul>
<li><a href="https://link.zhihu.com/?target=http%3A//www.golinuxhub.com/2014/03/step-by-step-linux-boot-process.html">linux启动流程</a> 中，容器需要使用其中的几步？ <img src="https://pic3.zhimg.com/80/9881b7d20842e3a8efa097ef63291a1b_hd.jpg" alt=""></li>
</ul>
<p>如图，linux的启动流程</p>
<h2 id="0-从fork说起"><a href="#0-从fork说起" class="headerlink" title="0 从fork说起"></a>0 从fork说起</h2><p>在讲解容器之前，先来谈谈linux实现进程的原理，linux实现进程的方法为fork，实现的方式分为两个步骤：</p>
<ol>
<li><p>在内存中复制一个父进程，得到“子进程”，此时子进程就是父进程上下文的简单克隆，内容完全一致</p>
</li>
<li><p>设置子进程的 pid，parent_pid，以及其他和父进程不一致的内容</p>
</li>
</ol>
<h2 id="1-namespace让进程隔离更灵活"><a href="#1-namespace让进程隔离更灵活" class="headerlink" title="1 namespace让进程隔离更灵活"></a>1 namespace让进程隔离更灵活</h2><p>从进程被制造的步骤可以看出，进程大部分资源和父进程共享，如果需要制造一个看起来像虚拟机的进程，我们需要比普通的进程多做几步。</p>
<ul>
<li><p>可以自定义rootfs，比如我们把整个ubuntu发行版的可执行文件以及其他文件系统都放在目录/home/admin/ubuntu/ 下，当我们重定义rootfs = /home/admin/ubuntu 后，则该文件地址被印射为 “/“</p>
</li>
<li><p>把自身pid 印射为0，并看不到其他任何的pid，这样自身的pid成为系统内唯一存在pid，看起来就像新启动了系统</p>
</li>
<li><p>用户名隔离，可以把用户名设置为“root”</p>
</li>
<li><p>hostname隔离，可以另取一个hostname，成为新启动进程的hostname</p>
</li>
<li><p>IPC隔离，隔离掉进程之间的互相通信</p>
</li>
<li><p>网络隔离，隔离掉进程和主机之间的网络</p>
</li>
</ul>
<p>如果做完这几步，至少在进程自身看来，和虚拟机执行环境上已经区别不大了，对应到linux系统中，这几个隔离需要的方法：<a href="https://link.zhihu.com/?target=http%3A//man7.org/linux/man-pages/man2/clone.2.html">clone(2) - Linux manual page</a></p>
<p>而clone方法和fork方法，在复制上下文的时候，调用的都是syscall_clone() 本质上它们是差不多的。</p>
<h2 id="2-其实docker是一个内核的搬运工"><a href="#2-其实docker是一个内核的搬运工" class="headerlink" title="2 其实docker是一个内核的搬运工"></a>2 其实docker是一个内核的搬运工</h2><p>所以虽然docker帮助我们准备好了rootfs地址，镜像里面的文件，以及各种资源隔离的配置，但是在启动一个容器的时候，它只是调用系统中早已内置的可以隔离资源的方法，而kernel支持这些方法，也是在创建进程的方法上做了一层资源隔离的扩展而已。</p>
<p>这就解释了docker两个特性：</p>
<ul>
<li><p>启动速度快，因为本质来说容器和进程差别没有想象中的大，共享了很多代码，流程也差的不多</p>
</li>
<li><p>linux内核版本有最低的要求，因为linux是在某个版本后开始支持隔离特性</p>
</li>
</ul>
<h2 id="3-容器内创建进程-—-Think-a-step-further"><a href="#3-容器内创建进程-—-Think-a-step-further" class="headerlink" title="3 容器内创建进程 — Think a step further"></a>3 容器内创建进程 — Think a step further</h2><p>这是我认为整个容器实现里面最优美的一点：</p>
<ul>
<li><p>内核开发者实现了容器的资源隔离一系列隔离后，内核开发者就不需要为容器内创建进程单独再做任何多余的工作了。</p>
</li>
<li><p>在fork方法中，第一步就是继承父进程的一切，而这一切包含了父进程已有的资源隔离，所以容器进程创建的进程天然继承容器所有的一切资源隔离 —— 就和虚拟机的pid = 0 的进程创建子进程所拥有的一样</p>
</li>
</ul>
<h2 id="4-One-more-thing"><a href="#4-One-more-thing" class="headerlink" title="4 One more thing"></a>4 One more thing</h2><p>让我们再来看看开篇提出的问题：</p>
<p><a href="https://link.zhihu.com/?target=http%3A//www.golinuxhub.com/2014/03/step-by-step-linux-boot-process.html">linux启动流程</a> 中，容器需要使用其中的几步？</p>
<p>看完了fork，clone以及一大堆隔离后，相信读者很容易有答案了，这中间容器做完了隔离之后就算启动完毕，根本就不会来做kernel init之类的步骤，所以答案是一步都不用。</p>
<h2 id="5-how-to-learn-more"><a href="#5-how-to-learn-more" class="headerlink" title="5 how to learn more"></a>5 how to learn more</h2><ul>
<li><p>比较除docker外其他的容器类产品，如coreOS，LXC</p>
</li>
<li><p>了解linux如何做隔离，请参考：<a href="https://link.zhihu.com/?target=http%3A//man7.org/linux/man-pages/man7/namespaces.7.html">namespaces(7)</a></p>
</li>
<li><p>了解freebsd如何做隔离，请参考：<a href="https://link.zhihu.com/?target=https%3A//www.freebsd.org/doc/handbook/jails.html">freebsd jail</a></p>
</li>
<li><p>docker 其实真正想做的事情是把资源隔离的接口标准化（最新的版本里windows的接口也被抽象到了docker自己的体系），严格说它是所有相似资源隔离的一层抽象和搬运工</p>
</li>
<li><p>docker 镜像很小的优势，主要是靠AUFS实现的，本篇不详细说明，因为AUFS在docker原理介绍的口水文里被用滥了，随便搜搜到处都是，而且我很不喜欢官方用的集装箱比喻</p>
</li>
</ul>

  </div>
</article>



        
          <div id="footer-post-container">
  <div id="footer-post">

    <div id="nav-footer" style="display: none">
      <ul>
         
          <li><a href="/">Home</a></li>
         
          <li><a href="/about/">About</a></li>
         
          <li><a href="/archives/">Writing</a></li>
         
          <li><a href="/projects_url">Projects</a></li>
        
      </ul>
    </div>

    <div id="toc-footer" style="display: none">
      <ol class="toc"><li class="toc-item toc-level-1"><a class="toc-link" href="#一篇不一样的docker原理解析-提高篇"><span class="toc-number">1.</span> <span class="toc-text">一篇不一样的docker原理解析 提高篇</span></a><ol class="toc-child"><li class="toc-item toc-level-2"><a class="toc-link" href="#0-从fork说起"><span class="toc-number">1.1.</span> <span class="toc-text">0 从fork说起</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#1-namespace让进程隔离更灵活"><span class="toc-number">1.2.</span> <span class="toc-text">1 namespace让进程隔离更灵活</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#2-其实docker是一个内核的搬运工"><span class="toc-number">1.3.</span> <span class="toc-text">2 其实docker是一个内核的搬运工</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#3-容器内创建进程-—-Think-a-step-further"><span class="toc-number">1.4.</span> <span class="toc-text">3 容器内创建进程 — Think a step further</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#4-One-more-thing"><span class="toc-number">1.5.</span> <span class="toc-text">4 One more thing</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#5-how-to-learn-more"><span class="toc-number">1.6.</span> <span class="toc-text">5 how to learn more</span></a></li></ol></li></ol>
    </div>

    <div id="share-footer" style="display: none">
      <ul>
  <li><a class="icon" href="http://www.facebook.com/sharer.php?u=http://yoursite.com/2018/12/21/%E4%B8%80%E7%AF%87%E4%B8%8D%E4%B8%80%E6%A0%B7%E7%9A%84docker%E5%8E%9F%E7%90%86%E8%A7%A3%E6%9E%90%E6%8F%90%E9%AB%98%E7%AF%87/" target="_blank" rel="noopener"><i class="fab fa-facebook fa-lg" aria-hidden="true"></i></a></li>
  <li><a class="icon" href="https://twitter.com/share?url=http://yoursite.com/2018/12/21/%E4%B8%80%E7%AF%87%E4%B8%8D%E4%B8%80%E6%A0%B7%E7%9A%84docker%E5%8E%9F%E7%90%86%E8%A7%A3%E6%9E%90%E6%8F%90%E9%AB%98%E7%AF%87/&text=一篇不一样的docker原理解析提高篇" target="_blank" rel="noopener"><i class="fab fa-twitter fa-lg" aria-hidden="true"></i></a></li>
  <li><a class="icon" href="http://www.linkedin.com/shareArticle?url=http://yoursite.com/2018/12/21/%E4%B8%80%E7%AF%87%E4%B8%8D%E4%B8%80%E6%A0%B7%E7%9A%84docker%E5%8E%9F%E7%90%86%E8%A7%A3%E6%9E%90%E6%8F%90%E9%AB%98%E7%AF%87/&title=一篇不一样的docker原理解析提高篇" target="_blank" rel="noopener"><i class="fab fa-linkedin fa-lg" aria-hidden="true"></i></a></li>
  <li><a class="icon" href="https://pinterest.com/pin/create/bookmarklet/?url=http://yoursite.com/2018/12/21/%E4%B8%80%E7%AF%87%E4%B8%8D%E4%B8%80%E6%A0%B7%E7%9A%84docker%E5%8E%9F%E7%90%86%E8%A7%A3%E6%9E%90%E6%8F%90%E9%AB%98%E7%AF%87/&is_video=false&description=一篇不一样的docker原理解析提高篇" target="_blank" rel="noopener"><i class="fab fa-pinterest fa-lg" aria-hidden="true"></i></a></li>
  <li><a class="icon" href="mailto:?subject=一篇不一样的docker原理解析提高篇&body=Check out this article: http://yoursite.com/2018/12/21/%E4%B8%80%E7%AF%87%E4%B8%8D%E4%B8%80%E6%A0%B7%E7%9A%84docker%E5%8E%9F%E7%90%86%E8%A7%A3%E6%9E%90%E6%8F%90%E9%AB%98%E7%AF%87/"><i class="fas fa-envelope fa-lg" aria-hidden="true"></i></a></li>
  <li><a class="icon" href="https://getpocket.com/save?url=http://yoursite.com/2018/12/21/%E4%B8%80%E7%AF%87%E4%B8%8D%E4%B8%80%E6%A0%B7%E7%9A%84docker%E5%8E%9F%E7%90%86%E8%A7%A3%E6%9E%90%E6%8F%90%E9%AB%98%E7%AF%87/&title=一篇不一样的docker原理解析提高篇" target="_blank" rel="noopener"><i class="fab fa-get-pocket fa-lg" aria-hidden="true"></i></a></li>
  <li><a class="icon" href="http://reddit.com/submit?url=http://yoursite.com/2018/12/21/%E4%B8%80%E7%AF%87%E4%B8%8D%E4%B8%80%E6%A0%B7%E7%9A%84docker%E5%8E%9F%E7%90%86%E8%A7%A3%E6%9E%90%E6%8F%90%E9%AB%98%E7%AF%87/&title=一篇不一样的docker原理解析提高篇" target="_blank" rel="noopener"><i class="fab fa-reddit fa-lg" aria-hidden="true"></i></a></li>
  <li><a class="icon" href="http://www.stumbleupon.com/submit?url=http://yoursite.com/2018/12/21/%E4%B8%80%E7%AF%87%E4%B8%8D%E4%B8%80%E6%A0%B7%E7%9A%84docker%E5%8E%9F%E7%90%86%E8%A7%A3%E6%9E%90%E6%8F%90%E9%AB%98%E7%AF%87/&title=一篇不一样的docker原理解析提高篇" target="_blank" rel="noopener"><i class="fab fa-stumbleupon fa-lg" aria-hidden="true"></i></a></li>
  <li><a class="icon" href="http://digg.com/submit?url=http://yoursite.com/2018/12/21/%E4%B8%80%E7%AF%87%E4%B8%8D%E4%B8%80%E6%A0%B7%E7%9A%84docker%E5%8E%9F%E7%90%86%E8%A7%A3%E6%9E%90%E6%8F%90%E9%AB%98%E7%AF%87/&title=一篇不一样的docker原理解析提高篇" target="_blank" rel="noopener"><i class="fab fa-digg fa-lg" aria-hidden="true"></i></a></li>
  <li><a class="icon" href="http://www.tumblr.com/share/link?url=http://yoursite.com/2018/12/21/%E4%B8%80%E7%AF%87%E4%B8%8D%E4%B8%80%E6%A0%B7%E7%9A%84docker%E5%8E%9F%E7%90%86%E8%A7%A3%E6%9E%90%E6%8F%90%E9%AB%98%E7%AF%87/&name=一篇不一样的docker原理解析提高篇&description=" target="_blank" rel="noopener"><i class="fab fa-tumblr fa-lg" aria-hidden="true"></i></a></li>
  <li><a class="icon" href="https://news.ycombinator.com/submitlink?u=http://yoursite.com/2018/12/21/%E4%B8%80%E7%AF%87%E4%B8%8D%E4%B8%80%E6%A0%B7%E7%9A%84docker%E5%8E%9F%E7%90%86%E8%A7%A3%E6%9E%90%E6%8F%90%E9%AB%98%E7%AF%87/&t=一篇不一样的docker原理解析提高篇" target="_blank" rel="noopener"><i class="fab fa-hacker-news fa-lg" aria-hidden="true"></i></a></li>
</ul>

    </div>

    <div id="actions-footer">
        <a id="menu" class="icon" href="#" onclick="$('#nav-footer').toggle();return false;"><i class="fas fa-bars fa-lg" aria-hidden="true"></i> Menu</a>
        <a id="toc" class="icon" href="#" onclick="$('#toc-footer').toggle();return false;"><i class="fas fa-list fa-lg" aria-hidden="true"></i> TOC</a>
        <a id="share" class="icon" href="#" onclick="$('#share-footer').toggle();return false;"><i class="fas fa-share-alt fa-lg" aria-hidden="true"></i> Share</a>
        <a id="top" style="display:none" class="icon" href="#" onclick="$('html, body').animate({ scrollTop: 0 }, 'fast');"><i class="fas fa-chevron-up fa-lg" aria-hidden="true"></i> Top</a>
    </div>

  </div>
</div>

        
        <footer id="footer">
  <div class="footer-left">
    Copyright &copy; 2020 Tmoonlight
  </div>
  <div class="footer-right">
    <nav>
      <ul>
         
          <li><a href="/">Home</a></li>
         
          <li><a href="/about/">About</a></li>
         
          <li><a href="/archives/">Writing</a></li>
         
          <li><a href="/projects_url">Projects</a></li>
        
      </ul>
    </nav>
  </div>
</footer>

    </div>
    <!-- styles -->

<link rel="stylesheet" href="/lib/font-awesome/css/all.min.css">


<link rel="stylesheet" href="/lib/justified-gallery/css/justifiedGallery.min.css">


    <!-- jquery -->

<script src="/lib/jquery/jquery.min.js"></script>


<script src="/lib/justified-gallery/js/jquery.justifiedGallery.min.js"></script>

<!-- clipboard -->

  
<script src="/lib/clipboard/clipboard.min.js"></script>

  <script type="text/javascript">
  $(function() {
    // copy-btn HTML
    var btn = "<span class=\"btn-copy tooltipped tooltipped-sw\" aria-label=\"Copy to clipboard!\">";
    btn += '<i class="far fa-clone"></i>';
    btn += '</span>'; 
    // mount it!
    $(".highlight table").before(btn);
    var clip = new ClipboardJS('.btn-copy', {
      text: function(trigger) {
        return Array.from(trigger.nextElementSibling.querySelectorAll('.code')).reduce((str,it)=>str+it.innerText+'\n','')
      }
    });
    clip.on('success', function(e) {
      e.trigger.setAttribute('aria-label', "Copied!");
      e.clearSelection();
    })
  })
  </script>


<script src="/js/main.js"></script>

<!-- search -->

<!-- Google Analytics -->

<!-- Baidu Analytics -->

<!-- Disqus Comments -->


</body>
</html>
